#!/bin/bash

result_file="file.order.all"

## cleanup result file
rm -f ${result_file}-tmp-*

## normal infos
for i in `seq 0 7`;
do

     mysql -h 127.0.0.1 -P 23666 -u test -p7c3962d66f492290 -D db_trade  -e "select order_id from t_order_$i where in_turn = 1 "|grep -v order_id|sed 's/^/order,&/g' >> x

done

cat ${result_file}-tmp-* > $result_file
rm -f ${result_file}-tmp-*

## finished

echo "finished!"

